package uk.ac.manchester.cs.owl.mumbmf.queryexecution;

/**
 * Created by
 * User: Samantha Bail
 * Date: 07/09/2012
 * Time: 18:24
 * The University of Manchester
 */


public class UsageInfo {

//    /*
//    * print command line options
//    */
//    public static void printBenchmarkInfo() {
//        String output = "Usage: java benchmark.testdriver.TestDriver <options> SPARQL-Endpoint\n\n"
//                + "SPARQL-Endpoint: The URL of the HTTP SPARQL Endpoint\n\n"
//                + "Possible options are:\n"
//                + "\t-runs <number of query mix runs>\n" + "\t\tdefault: "
//                + TestDriverDefaultValues.nrRuns
//                + "\n"
//                + "\t-ucf <use case file name>\n"
//                + "\t\tSpecifies where the use case description file can be found.\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.usecaseFile
//                + "\n"
//                + "\t-w <number of warm up runs before actual measuring>\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.warmups
//                + "\n"
//                + "\t-o <benchmark results output file>\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.resultFileExtension
//                + "\n"
//                + "\t-dg <Default Graph>\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.defaultGraph
//                + "\n"
//                + "\t-sql\n"
//                + "\t\tuse JDBC connection to a RDBMS. Instead of a SPARQL-Endpoint, a JDBC URL has to be supplied.\n"
//                + "\t\tdefault: not set\n"
//                + "\t-mt <Number of clients>\n"
//                + "\t\tRun multiple clients concurrently.\n"
//                + "\t\tdefault: not set\n"
//                + "\t-seed <Long Integer>\n"
//                + "\t\tInit the Test Driver with another seed than the default.\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.seed
//                + "\n"
//                + "\t-t <timeout in ms>\n"
//                + "\t\tTimeouts will be logged for the result report.\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.timeoutInMs
//                + "ms\n"
//                + "\t-dbdriver <DB-Driver Class Name>\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.driverClassName
//                + "\n"
//                + "\t-u <Sparql Update Service Endpoint URL>\n"
//                + "\t\tUse this if you have SPARQL Update queries in your query mix.\n"
//                + "\t-udataset <update dataset file name>\n"
//                + "\t\tSpecified an update file generated by the BSBM dataset generator.\n"
//                + "\t-q\n"
//                + "\t\tTurn on qualification mode instead of doing a test run.\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.qualification
//                + "\n"
//                + "\t-qf <qualification file name>\n"
//                + "\t\tTo change the  filename from its default.\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.qualificationFile
//                + "\n"
//                + "\t-rampup\n"
//                + "\t\tRun ramp-up to reach steady state.\n"
//                + "\t-uqp <update query parameter>\n"
//                + "\t\tThe forms parameter name for the query string.\n"
//                + "\t\tdefault: "
//                + TestDriverDefaultValues.updateQueryParameter
//                + "\n";
//
//        System.out.print(output);
//    }
//

    public static void printUiUsage() {
        System.out.println("\nThe benchmark should be run with one of the following flags as the first command line argument:");
        System.out.println("\t-g to generate a set of queries for one or multiple query types (1)");
        System.out.println("\t-b to run the benchmark for one or multiple query types (2)");
        System.out.println("\t-m to generate a set of queries and run the benchmark multiple times (3)");

        System.out.println("\n(1) The following are command line arguments to control the behaviour of the query generation process.");
        System.out.println("\t-seedtype [sparql|sql|obda] Specify which query type to use to generate parameters (usually fastest: SQL)");
        System.out.println("\t-output <output directory> The location to store the generated query files.");
        System.out.println("\t-qmfile <filename> File containing details of the query mix.");

        System.out.println("\t-sparql <query templates file> The XML file containing the parameterised SPARQL queries for the benchmark.");
        System.out.println("\t-sql <query templates file> The XML file containing the parameterised SQL queries for the benchmark.");
        System.out.println("\t-obda <query templates file> The XML file containing the parameterised OBDA queries for the benchmark.");

        System.out.println("\t-igfile <filename> File which specifies the queries to be ignored (can be empty).");
        System.out.println("\t-dbdriver <DB-Driver Class Name> (Required if generating sql queries)");
        System.out.println("\t-dbserver <url> (Required for sql queries) Location of the database server.");
        System.out.println("\t-dblogin <username> (Required for sql queries) Username for accessing the database.");
        System.out.println("\t-dbpw <password> (Required for sql queries) Password for accessing the database.");
        System.out.println("\t-sparqlendpoint <SPARQL endpoint URL> Location of the SPARQL endpoint.");
        System.out.println("\t-owlfile <filename> OWL ontology for use with OBDA.");
        System.out.println("\t-obdafile <filename> OBDA mappings file.");


        System.out.println("\n(2) The following are command line arguments to vary the behaviour of the benchmark framework when running the benchmark.");
        System.out.println("\t-type [sparql|sql|obda] Specify whether to benchmark sparql, obda, or sql queries.");
        System.out.println("\t-runs <number of runs> (Default: 50) The number of query mix runs.");
        System.out.println("\t-ucf <path to use case file> Specifies the use case, which in turn defines the combination of queries from one or more query mixes. Different use cases are found under the \"usecase\" directory.");
        System.out.println("\t-w <number of warm-up runs> (Default: 10) Number of runs executed before the actual test to warm up the store.");
        System.out.println("\t-results <result file> (Default: results) The output directory containing the XML results output.");
        System.out.println("\t-df <default graph URI> (Default: null) Specify a default graph for the queries.");
        System.out.println("\t-dbdriver <DB-Driver Class Name> (Required if generating sql queries)");
        System.out.println("\t-dbserver <url> (Required for sql queries) Location of the database server.");
        System.out.println("\t-dblogin <username> (Required for sql queries) Username for accessing the database.");
        System.out.println("\t-dbpw <password> (Required for sql queries) Password for accessing the database.");
        System.out.println("\t-sparqlendpoint <SPARQL endpoint URL> Location of the SPARQL endpoint.");
        System.out.println("\t-owlfile <filename> OWL ontology for use with OBDA.");
        System.out.println("\t-obdafile <filename> OBDA mappings file.");
        System.out.println("\t-seed <long value> seed for randomisation");
        System.out.println("\t-t <Timeout in ms> (Default: no timeout) If for a specific query the complete result is not read after the specified timeout, the client disconnects and reports a timeout to the Test Driver. This is also the maximum runtime a query can contribute to the metrics.");

        System.out.println("\n(3) The following are command line arguments to generate and run the benchmark multiple times:");
        System.out.println("\t-genargs <filename> Plain text file which contains the arguments to generate queries.");
        System.out.println("\t-sparql <\"filename \"> List of SPARQL benchmark parameters enclosed in quotes.");
        System.out.println("\t-obda <\"filename \"> List of OBDA benchmark parameters enclosed in quotes.");
        System.out.println("\t-sql <\"filename \"> List of SQL benchmark parameters enclosed in quotes.");
        System.out.println("\t-querysets <number of sets> (Default: 1) Number of query sets to generate (i.e. number of generate/benchmark loops).");

        System.out.println("\nThe following parameters have not been implemented yet:");
        System.out.println("\t-mt <number of clients> Benchmark with multiple concurrent clients, currently not implemented.");
        System.out.println("\t-q  Turn on qualification mode. For more information, see the qualification chapter of the use case.");
        System.out.println("\t-qf <qualification file name> Change the qualification file name, also see the qualification chapter of the use case.");
        System.out.println("\t-rampup  Run test driver in ramp-up/warm-up mode. The test driver will execute randomized queries until it is stopped - ideally when the store reached steady state and is not improving any more.");
        System.out.println("\t-u <Service endpoint URI for SPARQL Update>   If you are running update queries in your uk.ac.manchester.cs.owl.mumbmf.tests this option defines where the SPARQL update service endpoint can be found.");
        System.out.println("\t-udataset <file name>   The file name of the update dataset.");
        System.out.println("\t-uqp <update query parameter> (Default: update)  The forms parameter name for the SPARQL Update query string.\n");


    }
}
